Repository navigation
🤖 feat: Cursor plugin hooks: trust, file review and runner - #7846
Conversation
… cursor-plugins/hooks
Cursor plugin RFC PR 8, first unit: Cursor hooks.json parsing in discovery (cursorHooks.ts), the cursor-command/cursor-prompt handler variants, the per-call trust gate in the plugin's own format, the Cursor command hook runner (cursorHookRunner.ts) with its own gate, the turn.stop abort signal, and the LocalBaseRuntime abort race fix. The file review and the renderer follow in later commits. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Cursor plugin RFC PR 8.7: cursorHooks.test.ts (ralph-loop and advisor hooks.json, hashes, loop_limit and declared, reasons, containment and caps), cursorHookRunner.test.ts (input, environment, working folder, afterFileEdit, stop output, failure table, kill switches, remote runtimes, trust, abort at three points with the local runtime, timeouts and full pipes), the Cursor gate in codexHookService.test.ts, and the turn.stop abort signal in agentSession.turnStopHooks.test.ts. Formats cursorManifest.ts and discovery.ts. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
…preview The user trusts a Cursor hook by the hash of its exact hooks.json entry, so the review must show every hashed field and say in Cursor terms why a hook does not run (Cursor plugin RFC 5.1 "Trust display" and "Status", 5.6, 8.6). - hookStatusNote(hook): a Cursor hook names its own reason (cursorHookNotAppliedReason), never the Codex note "Xum runs only mcp_tool hooks". The hooks panel and the install preview hook list share it. - hookReviewDetail(handler): the panel shows a Cursor entry as declared, with invisible and bidi controls marked, cut like an mcp_tool input; Trust waits until a cut entry is expanded. - Event, matcher and command summary mark every control (showOneLineControls), so a tab or newline cannot make two hashes look alike. - Each Cursor hook notes it does not run in remote workspaces; a cursor-command hook that is not trusted says it runs a command in your workspace. - Stories: CursorHooksReview and its 390 px phone variant.
The Cursor entry display grew PluginHooksPanel past its CRAP floor (CC 34 -> 37). HookReviewDetailText renders a hook's hashed text and its "Show full" control, so the panel is back to CC 34.
The CRAP gate refused the first cut: the entry parser, the start gate, the exit-code table and the stop output each become their own function, the hook service's trust filter and per-format registration move out of ensureWorkspaceHooks, and the two exec abort checks and the hard-Stop hook abort get named helpers, so no touched function grows. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
…rsor-plugins/hooks # Conflicts: # src/node/services/agentPlugins/discovery.ts
--- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
…n throws A process that leaves the hook's process group (job control, setsid) can hold stdout open after the hook exits, which held the turn.stop chain. The call now ends at its timeout plus a short grace, as a failure. A throw from the trust gate or the spawn is a failed call with a notice, never a broken hook point. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Add ralph-loop-cursor to the bug-bash hook fixtures: cursor/plugins
ralph-loop at 4dd1d05 (plugin.json, hooks.json, both hook scripts, the
ralph-loop and cancel-ralph skills), checked against each file's git
blob SHA, with only the two hook commands changed to
`bash "${CURSOR_PLUGIN_ROOT}/hooks/<script>.sh"` (D17). The seed installs
it like the other hook fixtures.
Add repros/cursorStopHookLoop.e2e.ts (bugbash, cursor-stop-loop,
mock-only): after the user trusts both hooks, the stop hook continues
the turn twice and stops once the reply holds <promise>DONE</promise>.
A Stop during a continued turn adds no continuation and leaves the loop
active, and cancel-ralph ends it. The mock runs no tool, so the test
writes and deletes the ralph state file itself, as the skills say.
The repro needs the cursor-plugin install method (RFC PR 2): on this
base a Cursor package installs as Skills and its hooks do not load.
listPluginTreeRecords returns one record per file, symlink and directory of a plugin tree: the path relative to the plugin folder (forward slashes), the mode, and the content hash or link text. A file of at most keepBytesUpTo bytes keeps the bytes that the hashing read returned, so a review shows the hashed bytes without a second open. skipRootGit skips a staged clone's top-level .git before the quota counts it. hashPluginTree is now a wrapper over the same walk and keeps its value on every folder (checked against the old implementation).
A Cursor command hook can run or source any file of its plugin, so a staged plugin with a runnable cursor-command hook gets a review of its files (RFC D1, D30). The install preview lists every staged file as added in fileChanges. The update review appends a row per added, removed or changed file to changes, against the installed tree when that tree also has a runnable Cursor command hook, else against the empty tree. A UTF-8 text file of at most 64 KiB shows its text with invisible controls marked, a symlink shows its link text, any other file shows only the summary. File names pass through showOneLineControls. assertReviewFits covers the rows at install and at update.
PreviewDisclosures lists preview.fileChanges under "Files (n)" with the update review's row component, and says that a command hook of the plugin can run any of these files. Install stays disabled until the user shows the full text of every row text cut at the display bound, as the update review gates Confirm. The cut-text helpers now take a change list instead of a whole update review. The phone consent preview story gets file rows.
The CRAP gate refused the new walk (CC 26), fileReviewRows (CC 11) and the growth of collectCapabilityChanges (CC 38 -> 41). The walk now hashes each file in hashWalkedFile, and a stat-field table replaces the two comparison chains. One method, fileReviewChanges, decides the rows for the install preview and the update review, so collectCapabilityChanges keeps its CC. fileReviewRow builds one row. hashPluginTree still gives the old value on every folder the comparison script checked.
…view hashPluginTree and the file review compared the same "hash, link text or empty" value through two copies of one expression. treeHash.ts now exports pluginTreeRecordContent and both use it.
A review whose kept text could never fit its size cap now fails while the walk runs, before it holds up to the staged-tree quota in memory (it was up to 100 MB per tree, two trees per update). The tree walk becomes a small class so no function passes the CRAP limit; hashPluginTree gives the same value as before on three folders (checked against the old code). --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
--- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Delete comments that restate code, narrate, or name review history in the Cursor command hooks diff. Comment-only change.
…iew references Codex and Cursor hook runners share PLUGIN_HOOK_ORDER_BASE instead of two equal constants. claimKeptBytes names what the walk's byte check does. The hook service keeps its module overview and the review-thread references of the comments this change moved. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
… unreviewed --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
…remote note --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
…ctory --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
… cursor-plugins/hooks # Conflicts: # src/browser/features/Settings/Sections/PluginsSettingsSection.tsx # src/node/services/agentPlugins/installService.ts
…fields --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Security verifier finding F1: a binary file or one over 64 KiB showed only its summary, which read like a harmless change. Its row now says "contents not shown: binary or larger than 64 KiB", in the install preview and the update review. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
…27 command Security verifier finding F3: the hooks panel showed the hooks file path and the hook warnings as plugin text, and the exit 127 notice quoted the command, all with control characters unmarked. A bidi override there could reorder the text the user reads. Each now goes through showOneLineControls, the helper the file review summaries use, so such a character shows as <U+XXXX>. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
…hat is not runnable Security verifier finding F4, test-only. Three guards had no test that fails without them: - requestHooks passes `sideChat: true` for a side chat, so no Cursor command hook runs beside the main chat's work. - stdout over 64 KiB is refused by its size even when it is valid JSON with a followup_message (one byte over: the runner reads a few bytes past the limit). - a hook the trust gate allows but whose status is not runnable (a matcher) starts no process. Each test fails with its guard removed. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
PR 9 (cursor-plugins/docs, 433e6dc) adds the same two preview fields to this fixture, with notApplied after codexHooks. The same placement here lets that branch merge this one without a conflict in the file. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Delta verifier finding F3b: the install preview showed its warnings raw, and the Cursor hook warnings there quote plugin text such as an event name. A bidi override in the name could reorder the warning. The preview now marks it with showOneLineControls, as the hooks panel does. Tests: a hook warning with U+202E shows <U+202E> in the install preview, and the hooks panel marks it in the hooks file path and in a warning. Each test fails with its mark removed. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Codex review of the RFC, P2: a hook that the parser drops (a negative, fractional or non-number loop_limit, no command string, an entry that is not an object, an event that is not an array) only got a warning, so the plugin's "Not applied in Xum" list did not name it (CUJ 5). Each now gets a hook row with its parse reason. The rows stop at 50, as the warnings do, because a 256 KiB file can hold thousands of bad entries. The display marks control characters in the names, as for every not-applied row. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
The digest check raised setHookTrust from CC 5 to 11 against the PR base, which the CRAP gate refuses above 10. assertFilesReviewed holds it now; the checks and their messages are unchanged. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 632b6d00ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Codex review of #7846, head 632b6d0, P2 (PRRT_kwDOPxxmWM6yTwSs): when a hook's child leaves the process group and keeps stdout open, the call ended at its grace deadline but its stream readers kept reading until the child exited, so repeated hook events could pile up readers and pipe handles. The runner now reads both pipes through a stream it cancels when the grace deadline wins. Xum still cannot kill a process outside the group; the test checks that the call cancels the pipe. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Self-review of bc7b469: rebindPluginHookTrust wrote the trust record after every update, so each updated plugin, Codex and Claude ones included, got an empty plugin-hook-trust file. The edit now reports whether it moved a binding, and nothing is written when it did not. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
…review digest Pre-push review of c5089e5 and 1447278: - A process past its output grace that never reads a full stdin pipe kept the input write pending. The release now aborts the stdin writer as well. - The first-trust digest hashed directory records, which the review does not show: a directory's mode change refused the trust with "files changed" and then showed the same rows. The digest now skips directories, as the rows do. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
The test set the skills folder to 0700, which can already be its mode, so it passed with the digest's directory filter removed. It now flips the mode, and it fails without the filter. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
lint-eslint (no-misused-promises): the abort listener returned the writer.abort() promise. It now drops it explicitly; nothing waits on it. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fa9bad2df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fa9bad2df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…roject workspace Codex review of #7846, head 8fa9bad, P2 (PRRT_kwDOPxxmWM6yUAPK): a local multi-project workspace runs in its container, so workspace_roots held only the container folder. Cursor defines it as the list of root folders, one per project. requestHooks now passes a callback that names each project's folder in the container (ContainerManager links each project under its name), read again on each call so a project added mid-session counts. A single-project workspace still sends the call's folder. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
The workspace_roots fallback raised startAndRead to CC 9, above the CRAP gate's new-function limit of 8. workspaceRootsOf holds it; the input is unchanged. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…hout a sandbox Codex review of #7846, P1 (PRRT_kwDOPxxmWM6yUCPZ): the prompt said the hook runs "in your workspace". The process runs as the user with HOME, and afterAgentResponse and afterFileEdit run in the plugin folder. It now says: "Once trusted, this hook runs a shell command on this computer as you, without a sandbox. It can read and change any file you can." --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
Codex review of #7846, P1 (PRRT_kwDOPxxmWM6yUCPa): the gate checked project trust and the hook's trust, then awaited the plugin's rediscovery, so a revoke during those reads still let the hook start. The gate now reads the plugin first and decides trust last: the trust-store read is its last await, and project trust is checked after it. Tests revoke project trust or turn the hook off while the gate's rediscovery runs; both fail with the old order. Known gap, a follow-up in the PR description: runtime.exec awaits its folder check before the spawn, so a revoke in that window still starts the process. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=xhigh -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e829acee95
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
The automated review loop on this PR stops here, at head Fixed during the loop
Rejected, with a reply on each thread
Deferred, listed under Follow-ups in the description
Every review thread has a reply and is resolved. Generated with |
Summary
Cursor plugins can now run their
stop,afterAgentResponseandafterFileEditcommand hooks in local and worktree workspaces. A hook runs only after the user trusts its exacthooks.jsonentry in Settings → Plugins. The consent boundary for the files a hook runs is a new file review: the install preview lists every plugin file, and an update lists every changed file and does not apply until the user approves it. Astophook'sfollowup_messagecontinues the turn under the per-hook limits of PR 7.Background
ThomasK33 asked for the Cursor plugin RFC as a reviewed, mergeable PR stack. This is PR 8 of that RFC:
rfc/20261030_cursor-plugin-support.md, "PR 8: Cursor hooks: parse, trust, update review and runner (security review)". Section 5 (Hooks) is its contract, with decisions D1, D5–D7, D25, D28 and D30.This PR is stacked on #7844 (PR 2, the Cursor marketplace and the
cursor-plugininstall method). Before this PR, Xum listed a Cursor package's hooks as "not applied". Cursor plugins such as ralph-loop need astophook to loop a turn (CUJ 3).Implementation
cursorHooks.ts). Discovery reads the hooks source the Cursor manifest names (a path inside the plugin folder, defaulthooks/hooks.json, or an inline object). Each entry becomes anAgentPluginHookSchemahook with acursor-commandhandler, orcursor-promptfortype: "prompt".key,hashanddeclaredfollow RFC 5.1. A hook that does not run (a prompt hook, an unmapped event, a matcher) gets anotAppliedrow with one reason, and so does an entry the parser drops (at most 50 such rows).declaredwith control characters marked, and Trust waits until a cut definition is expanded. A hook that does not run cannot be trusted.installService.ts,treeHash.ts). The install preview gainsfileChanges, one row per file or symlink of the plugin tree. An update's review lists each changed file with its before and after text. Any row blocks an update without consent. Only plugins with a runnable Cursor command hook get rows. While no Cursor command hook of a plugin is trusted, the hooks panel shows the same review of every file, and the first trust needs a digest of those rows (a plugin installed by a build without the file review never showed its files).cursorHookRunner.ts). It registers onturn.stop(afterAgentResponse, thenstop) and ontool.executeafter the edit tools (afterFileEdit). Every call checks the start conditions again (see Security decisions) and runs the command throughruntime.exec.turn.stopcontext gains an abort signal througheventSpine.ts,promptHooks.tsandagentSession.ts. A user Stop aborts running hooks, and a Stop before the chain starts gives it an aborted signal.LocalBaseRuntime.execchecks the abort again after its working-folder check.requestHooks.ts,codexHookService.ts). The hook service registers Cursor hooks next to Codex hooks, with its own gate: a Cursor command hook needs no plugin MCP, so a local workspace with several projects runs it. There,workspace_rootslists each project's folder in the workspace container.Security decisions
showOneLineControls, so a bidi or newline character shows as<U+XXXX>.XUM_DISABLE_AGENT_TOOLS,XUM_DISABLE_TERMINALS,XUM_DISABLE_PROJECT_AUTOMATION), a local runtime (registration only for local and worktree workspaces, never in a/sidechat), project trust, hash trust, a fresh reread of the plugin's own hooks, input up to 64 × 1024 characters, and no user Stop.PATHandHOME. Xum never setsCURSOR_USER_EMAILorCURSOR_CODE_REMOTE, and runs the command as written. The timeout is at most 30 s. Stdout is capped at 64 KiB, stderr is discarded, and both pipes are read while the hook runs. A call ends at its timeout plus 2 s even when a process that left its group holds stdout open, and it then lets go of the hook's three pipes.failClosedis parsed and hashed only. An unreadable trust store skips the call with a notice. Codex hooks keep their old silent behavior.reviewedSha, the installed commit when the user trusted it. An update this build applies (it reviewed the changed files) moves the binding to the new commit. A binding that does not match the registry'slockedShais dropped, and a trusted Cursor command hook without a binding reads as "changed": it does not run, and the hooks panel shows the full file review again. This covers an update that a build without this PR applied after a downgrade.reviewedShais a new optional field of the trust record. No other record tells this build that an older build changed the plugin.Deviations from the RFC
cursor-prompthandler variant sits besidecursor-command, so a prompt hook also carriesdeclaredand shows its Cursor reason.cursorHookNotAppliedReason(src/constants/pluginHooks.ts), gives the reason to the loader and to the panel. No schema field was added for it.AgentPluginInfo.cursorHooks. A newloadPluginHookspicks the Cursor or the Codex loader by plugin format. The hash and the per-plugin caps moved to a newhookDefinition.tsto avoid an import cycle.createRuntimeForWorkspacefor local and worktree workspaces..git, as the staged-tree quota check does.FakeRuntimegained an optionallocation. Two PR 1 tests changed, because inline hooks andhooks/hooks.jsonno longer get the "runs in a later Xum build" row.Validation
4ca374abcb(82 mutants, the real install, update and trust path in-process, a live dev server),5eb136a80eafter the first marketplace merge, and4022057c13with the first-trust file review. Its findings F1, F3, F3b, F5 (the downgrade gap, fixed after Codex raised it too) and the test gaps F4 and F6 (X3, X4) are fixed in this PR. The rest are listed under Follow-ups.tests/bugbash/repros/cursorStopHookLoop.e2e.tspasses 4/4 withBUGBASH_AI=mock, and it trusts its hooks through the first-trust UI.jq, which the ralph-loop plugin's hooks run, so the stop-loop repro also runs inTest / Bug-bash sandbox.Risks
Release note
Cursor plugins: Xum runs
stop,afterAgentResponseandafterFileEditcommand hooks in local and worktree workspaces after you trust each hook in Settings → Plugins, and reviews every plugin file at install (and at the first trust of a plugin's hooks) and every changed file at update. This PR has no row in RFC section 8: nothing changes for users without a Cursor plugin.Follow-ups
readPluginHookTrustCheckedduring registration and shows one notice.runtime.execthen awaits its working-folder check before the spawn. A trust revoke in that window still starts the process. Closing it needs a trust generation the runtime checks before the spawn.turn.stopabort signal stops Cursor command hooks (RFC 5.4). Codex Stop hooks still run their MCP calls to the end after a user Stop, as before this PR. Passing the signal into them changes Codex hook behavior, so it is a separate change.assertReviewFits(the size cap). The cap is in the code.#path refusal.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:xhigh• Cost:$91.77